package course.experiment2.num1;

public class Demo1 {
    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer();
        sb.append("java");
        System.out.println("添加字符串到末尾:"+sb);
        sb.insert(0 , "hello ");
        System.out.println("在指定的位置插入字符串:"+sb);
        sb.replace(5, 6, ",");
        System.out.println("替换指定位置的字符串:"+sb);
        sb.delete(5, 6);
        System.out.println("删除指定位置的字符:"+sb);
        sb.reverse();
        System.out.println("字符串翻转："+sb);
        System.out.println("字符串的长度为:"+sb.length());
        System.out.println("字符串里面字符为:"+sb.toString());
    }
}
